﻿using System;
using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Routing;
using Orchard.Mvc.Routes;

namespace AwesomeSlider
{
    public class Routes : IRouteProvider
    {
        public void GetRoutes(ICollection<RouteDescriptor> routes)
        {
            foreach (var routeDescriptor in GetRoutes())
                routes.Add(routeDescriptor);
        }

        public IEnumerable<RouteDescriptor> GetRoutes()
        {
            return new[] {
                new RouteDescriptor {
                    Route = new Route(
                        "Admin/Sliders",
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"},
                            {"controller", "SlidersAdmin"},
                            {"action", "Summary"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"}
                        },
                        new MvcRouteHandler())
                },
                new RouteDescriptor {
                    Route = new Route(
                        "Admin/Sliders/{sliderId}/RemoveSlider/{deleteFolder}",
                        new RouteValueDictionary {
                            {"deleteFolder", false},
                            {"area", "AwesomeSlider"},
                            {"controller", "SlidersAdmin"},
                            {"action", "RemoveSlider"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"}
                        },
                        new MvcRouteHandler())
                },
                new RouteDescriptor {
                    Route = new Route(
                        "Admin/Sliders/Create",
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"},
                            {"controller", "SlidersAdmin"},
                            {"action", "Create"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"}
                        },
                        new MvcRouteHandler())
                },
                    new RouteDescriptor {
                    Route = new Route(
                        "Admin/Sliders/{sliderId}/SliderItem/Add",
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"},
                            {"controller", "SliderItemAdmin"},
                            {"action", "Add"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"}
                        },
                        new MvcRouteHandler())
                },
                new RouteDescriptor {
                    Route = new Route(
                        "Admin/Sliders/{sliderId}/Edit",
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"},
                            {"controller", "SlidersAdmin"},
                            {"action", "Edit"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"}
                        },
                        new MvcRouteHandler())
                },
               new RouteDescriptor {
                    Route = new Route(
                        "Admin/Sliders/{sliderId}/SliderItem/UploadFile",
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"},
                            {"controller", "SliderItemAdmin"},
                            {"action", "UploadFile"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"}
                        },
                        new MvcRouteHandler())
                },
                new RouteDescriptor {
                    Route = new Route(
                        "Admin/Sliders/SliderItem/{sliderItemId}/Remove/{deleteFile}",
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"},
                            {"controller", "SliderItemAdmin"},
                            {"action", "Remove"},
                            {"deleteFile", false}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"}
                        },
                        new MvcRouteHandler())
                },
                new RouteDescriptor {
                    Route = new Route(
                        "Admin/Sliders/{sliderId}",
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"},
                            {"controller", "SlidersAdmin"},
                            {"action", "Item"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"}
                        },
                        new MvcRouteHandler())
                },
                new RouteDescriptor {
                    Route = new Route(
                        "Admin/Sliders/SliderItem/{sliderItemId}/Edit",
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"},
                            {"controller", "SliderItemAdmin"},
                            {"action", "Edit"}
                        },
                        new RouteValueDictionary(),
                        new RouteValueDictionary {
                            {"area", "AwesomeSlider"}
                        },
                        new MvcRouteHandler())
                }

            };
        }
    }
}